home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / bin / top < prev    next >
Text File  |  1995-07-22  |  561b  |  31 lines

  1. :
  2. # top - list the newest entries in the directory
  3. #       by default, list only the latest 10 entries
  4. #       the number of entries can be specified by the 1st argument
  5. #
  6. # written 7/95 by Ronald Joe Record (rr@sco.com)
  7. #
  8. # typically, i just type "top" to get the latest 10 entries in the current dir.
  9. # frequently i type "top 20" or "top 20 /tmp". You get the idea.
  10. #
  11.  
  12. HEAD="head -11"
  13. ARGS=-l
  14. DIR=.
  15.  
  16. while case "$1" in
  17.     "") break
  18.         ;;
  19.     -*) ARGS=$1
  20.         ;;
  21.     [0-9]*)  HEAD="head -`expr $1 + 1`"
  22.         ;;
  23.     *)  DIR=$1
  24.         ;;
  25.     esac
  26. do
  27.     shift
  28. done
  29.  
  30. ls ${ARGS}t $DIR | $HEAD
  31.